Add adaptive replacement cache#118
Conversation
|
Check the build system of linux-list for building test programs. |
Does the test programs here means new test case for testing cache? |
Exactly. These test programs should be built and verified before we integrate ARC into rv32emu core. |
810c16d to
18bfefa
Compare
jserv
left a comment
There was a problem hiding this comment.
- All test cases should be built from top-level Makefile.
- Test specific file should be placed in tests directory, and there are no file names in upper case.
- Show report of test cases and integrate into GitHub Actions.
ea22aad to
f835ab1
Compare
| $(VECHO) " CC\t$@\n" | ||
| $(Q)$(CC) $^ -o $(CACHE_BUILD_DIR)/$(TARGET) | ||
|
|
||
| $(CACHE_BUILD_DIR)/cache.o: src/cache.c |
There was a problem hiding this comment.
You can unify the rules by the following:
$(CACHE_BUILD_DIR)/%.o: $(CACHE_TEST_DIR)/%.c
There was a problem hiding this comment.
The directory of cache.c is src, but the directory of test_cache.c is tests/cache. So I cannot nuify the rules to this.
There was a problem hiding this comment.
No, you don't have to build $(CACHE_BUILD_DIR)/cache.o. Instead, only $(CACHE_BUILD_DIR)/test_cache.o should be built here. The test oriented rules always depend on the generation of $(OBJS).
There was a problem hiding this comment.
I see, cache.o would be built by make all
There was a problem hiding this comment.
However, the GitHub Action fails now, because we don't integrate the cache and it does not build cache.o.
There was a problem hiding this comment.
The appropriate sequence would be
make
make tests
Alternatively, you can extend item check to perform make tests.
There was a problem hiding this comment.
By the way, the next tests would be associated with #94 .
8e1e19f to
14f79c3
Compare
jserv
left a comment
There was a problem hiding this comment.
Resolve CI pipeline failure.
Current basic block management consumes a significant amount of memory, which leads to unnecessary waste due to frequent map allocation and release. Adaptive Replacement Cache (ARC) is a page replacement algorithm with better performance than least recently used (LRU). After the translated blocks are handled by ARC, better memory usage and hit rates can be achieved by keeping track of frequently used and recently used pages, as well as a recent eviction history for both. According to the cache information obtained while running CoreMark, the cache hit rate of ARC can reach over 99%.
Add adaptive replacement cache
Current basic block management consumes a significant amount of memory, which leads to unnecessary waste due to frequent map allocation and release. Adaptive Replacement Cache (ARC) is a page replacement algorithm with better performance than least recently used (LRU). After the translated blocks are handled by ARC, better memory usage and hit rates can be achieved by keeping track of frequently used and recently used pages, as well as a recent eviction history for both.
According to the cache information obtained while running CoreMark, the cache hit rate of ARC can reach over 99%.
see #105